package chapter12.jsjf;

import java.util.Arrays;

public class test {
    public static void main(String[] args) {
        ArrayHeap a = new ArrayHeap();
        int[]b = new int[8];
        int p =0;
        a.addElement(36);
        a.addElement(30);
        a.addElement(18);
        a.addElement(40);
        a.addElement(32);
        a.addElement(45);
        a.addElement(22);
        a.addElement(50);
        System.out.println("大顶堆层序遍历输出为： "+a.toString());
        while (!a.isEmpty()){
            Object temp=0;
            temp=a.removeMax();
            b[p]= (int) temp;
            p++;
            System.out.println("第"+p+"轮排序为： "+ Arrays.toString(b));
        }



    }
}
